This invention relates to the fields of computer systems and databases. More particularly, a system and methods are provided for serving a pre-generated presentation view of data in response to a request for the data.
The distributed nature of database operating environments is typically manifested by a multi-tier architecture in which client systems from which users submit data requests and operations are separated from a data server hosting a database containing the data being manipulated. A middle-tier server (e.g., a web server or application server) may be positioned between the client systems and the data server.
Thus, in a typical three-tier architecture a data request is originated at a client through a browser or other suitable interface. The request is submitted to a middle-tier server in a particular format (e.g., HTTP or Hypertext Transport Protocol). The HTTP request is received by a servlet (e.g., a server applet) or other module designed to parse the request, and an appropriate SQL (Structured Query Language) query is generated to locate the requested data in a database hosted by a data server. The middle-tier server then connects to the data server, the query is executed and a set of results is returned to the middle-tier server.
On the middle-tier server, the results may be transformed into a form suitable for returning to the client (e.g., a form recognizable and displayable by the client browser). For example, the data may be formatted according to XML (eXtensible Markup Language) and a style sheet may be applied to generate a presentation view of the data that can be readily displayed by the browser.
This method of retrieving, formatting and presenting data to a user is very resource-intensive. More specifically, each time the middle-tier server satisfies a data request, a measurable amount of processor time and memory are required to complete the task. In particular, generating the presentation view of the data can be especially demanding of the middle-tier server""s resources. For each additional user or request an additional increment of processor time and memory are required.
What is needed then is a system and a method for responding to a data request with suitable presentation views of the requested data, that scales well as additional requests are made. In particular, a desirable system and method would operate without requiring an unsupportable amount of resources during heavy periods of data requests.
In one embodiment of the invention a system and methods are provided for retrieving and serving presentation views of data targeted by data requests received at a middle-tier server (e.g., a web server, an application server). In this embodiment a database stores data that may be requested by users (e.g., through client browsers) and also stores presentation views of the data formatted to be readily displayable by the client browsers. Thus, a presentation view may be generated by applying a style sheet to the data to format the data according to HTML (Hypertext Markup Language), SGML (Standard Generalized Markup Language), WML (Wireless Markup Language), etc.
The presentation views are generated on a time and/or event basis, as specified by applicable triggers. Thus, one trigger may initiate the generation of a set of presentation views on a regular, time-sensitive, basis (e.g., every ten seconds, every hour). Another trigger may initiate the generation of a presentation view for a particular data item when that data item is altered, updated or replaced.
In one method of the invention a data request is received at a middle-tier server, which generates a suitable query to locate the requested data in a database. The middle-tier connects to a data server hosting the database (if the database is not resident on the middle-tier server) and the query is executed. Instead of receiving the queried data, which would then have to be formatted for service to the originator of the request, the data server provides a pre-generated presentation view of the data. The middle-tier server can then serve the presentation view, thereby greatly decreasing the level of middle-tier resources required to service the request.
An embodiment of the invention is customizable to individual client devices (e.g., smart telephone, wireless PDA (Personal Digital Assistant)). In this embodiment a first data request received at a middle-tier server from a client device may be handled in a pre-existing manner, in which the requested data is retrieved from a database, formatted on the middle-tier server and then served to the client. However, the capabilities and/or preferences of the client or user are noted and are then used to pre-generate presentation views of data in anticipation of another request from the same client. If another request is received, the customized presentation view can then be retrieved and quickly served rather than retrieving just the underlying data and having to generate the presentation view on the fly.